import request from '../request/index.js'
//查询用户
export function search(param) {
    let url = '/api/user/search'
    return request.post(url,{param})
}

//根据上级找出用户
export function sTop() {
    let url = '/api/user/top/search'
    // if(process.env.NODE_ENV == 'wg'){
        let data = {
            type : 0
         }
        return  request.post(url,data)
    // }else {
    //     return request.post(url)
    // }

}

export function info(uid) {
    let url = '/api/user/info'
    return request.post(url,{uid})
}

export function update(tem) {
    let url = '/api/user/update'
    tem.isLoading = true
    return request.post(url,tem)
}

//列出可修改的级别
export function listLevel() {
    let url = '/api/user/level'
    return request.get(url)
}

//修改级别
export function changeLevel(toUserId,levelId) {
    let url = '/api/user/level/change'
    let data = {
        toUserId,levelId
    }
    data.isLoading = true
    return request.post(url,data)
}

//获取验证码
export function getCode(mobile) {
    let url = '/api/user/captcha'
    let params = {mobile}
    return request.get(url,{params})
}
// 获取
export function getQrCode(page){
	let url = '/api/user/wx/app/qr/code'
	let params = {page}
	return request.get(url,{params})
}